.list-group-item
	h5.list-group-item-heading
		template(v-if="d.bittorrent")
			span {{ d.dir }}/{{ d.bittorrent.info.name }}
		template(v-else)
			span {{d.files && d.files[0].path}}

		span.pull-right
			span(v-if="d.gid && d.status!=='complete'")
				| {{ fz(d.restLength) }}
				| /
				| {{fz(d.downloadSpeed)}}/s
				| =
				| {{d.restDurationHumanize}}

	p.small.list-group-item-text {{fz(d.totalLength)}}
	template(v-if="d.bittorrent")
		p.small.list-group-item-text(
			v-for="f in d.files | orderBy 'length' -1"
			track-by="index"
		)
			span {{f.path.replace(d.dir+d.bittorrent.info.name) }}

			span.pull-right
				| {{ fz(f.completedLength) }}
				|/ 
				| {{ fz(f.length) }}
				| = 
				| {{(100*f.completedLength/f.length).toFixed(3)}}%
	p.small
	.clearfix
		.btn-group.pull-right(
			v-bind:class="{'open': detail}"
			@click="detail=!detail"
		)
			button.btn.btn-default.dropdown-toggle
				span.glyphicon.glyphicon-triangle-bottom
			ul.dropdown-menu
				li
					a(@click="remove()") 删除
		span.pull-right &nbsp;
		.btn-group.pull-right
			button.btn.btn-default(
				@click="toggleStatus(d)"
				v-if="d.status !== 'complete'"
			)
				span.glyphicon(
					v-bind:class=`
						{
							'glyphicon-pause': ['active', 'waiting'].includes(d.status),
							'glyphicon-play': ['paused', 'error'].includes(d.status),
						}
					`
				)
			button.btn.btn-default(
				@click="$router.go({name: 'edit', query: {gid: d.gid}})"
			)
				span.glyphicon.glyphicon-cog

				
